{% extends 'homepage.html' %}

{% block content %}

<script type="text/javascript" src="{{ url_for('.static', filename='elliptic_modular_form_util-functions.js') }}"></script>
<script type="text/javascript" src="{{ url_for('.static', filename='elliptic_modular_form_scripts.js') }}"></script>


<script>
$(document).ready( function() {
$("#wait").text("Plot of fundamental domain is loading!");
$("#plot").load(function() {
         $("#wait").text("");
    });
}
);

</script>
{% if info.error is defined %}

<h1>There was an error in meeting your previous request. Please change parameters.</h1>

<div> 
<h2> Error message: </h2>
{{ info.error | safe }}
</div>
{% endif %}

{% if info.weight is defined %}
<h1>{{ KNOWL('mf.elliptic.newform',title='Newforms') }} of {{KNOWL('mf.elliptic.level',title='level')}} {{level}} and {{KNOWL('mf.elliptic.weight',title='weight')}} {{weight}}</h1>
{% else %}
<h1>{{ KNOWL('mf.elliptic.newform',title='Newforms') }} of {{KNOWL('mf.elliptic.level',title='level')}} {{level}}</h1>
{% endif %}

{% if browse_table is defined %}
{% if browse_table.rows is defined %}
{#{KNOWL('mf.ellipticemf_browse.all.info',title='Write about browsing') }#}
<p>
The table below gives the dimensions of the space of holomorphic cusp
forms of specified level, weight, and character.  By clicking on an
entry you access information about the forms in the specified space.
</p>
{% set table = browse_table %}
{% set rows = browse_table.rows %}
{% set row_class = cycler('odd', 'even') %}
{% if show_all_characters is defined %}
{% set len = table.col_heads | length %}
{% set wid = 10*len +20 %}
<table class="ntdata" width="{{wid}}px">
  <thead>
    <tr>
      <th width="10px" style="border-right:1px solid black">
        {% if table.rowhead is defined %}
        {{ table.rowhead | safe }}
        {% endif %}
      </th>
      {% for ix in table.col_heads  %}
      <th width="10px">
        <!--a href="{{url_for('render_webpage_label',modulus=level,number=ix) }}" style="">{{ix}}</a-->
      </th>
      {% endfor %}
    </tr>
  </thead>
  <tbody>
    {% for row in rows  %}
    <tr class="{{row_class.next() }}">
      <th width="10px" style="background:#afa; border-right: 1px solid black">

        {{ table.row_heads[loop.index-1] }}

      </th>
      {% for cell in row  %}
      <td align="center" width="0%">
        <a style="" href="{{cell.url}}">{{cell.dim}}</a>
      </td>
      {% endfor %}
    </tr>
    {% endfor %}
  </tbody>
</table>
{% endif %}
{% endif %}
{% elif list_spaces is defined %}

{{ list_spaces | safe }}




{% endif %}

   {% if geometric is defined %}
      {% set G = geometric %}
      <table width="100%">
        <tr>
          <td valign="top">
            <div>
            {% if level > 1 %}
            {% set level = level %}
            {% set ti = "\(\Gamma_{0}( " ~ level  ~ ") \)" %} 
            <h2>Geometric information for {{KNOWL('mf.sl2.subgroup.gamma0N',title=ti)}}</h2>
            {% else %}
            <h2>Geometric information for {{KNOWL('mf.sl2z',title='PSL<sub>2</sub>\( (\mathbb{Z}) \)')}}</h2>
            {% endif %}
            </div>
          </td>
        </tr>
        <tr>
          <td valign="top">
            <table>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.index',title='index')}}</th><td>{{G.index}}</td></tr>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.genus',title='genus')}}</th><td>{{G.genus}}</td></tr>
              <tr><th>{{KNOWL('mf.sl2z.subgroup.cusps',title='cusps')}}</th><td>{{G.cusps}}</td></tr>
              <tr><th colspan="2">Number of {{KNOWL('mf.sl2z.subgroup.ellipticfxpts',title='elliptic fixed points')}} of </th></tr>
              <tr><th>order 2</th><td>{{G.nu2}}</td></tr>
              <tr><th>order 3</th><td>{{G.nu2}}</td></tr>
            </table>
          </td>
          {% endif %}
          {% if fd_plot is defined %}
          <td>
            <div>
              <span id="wait">      </span>
              <img id="plot" src="{{ fd_plot | safe }} " width="" height="75%"/>
            </div>
          </td>
        </tr>
      </table>
      {% endif %}

{% endblock content %}
